<?php

namespace App\Http\Requests\Api;


class AdRequest extends FormRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        switch ($this->method()){
            case "GET":{
                return [
                    "pid"=>"required|exists:ad_position,id",
                ];
            }
        }

    }

    public function attributes()
    {
        return [
            "pid"=>"广告类别",
        ];
    }

    public function messages()
    {
        return [
            "pid.required"=>"广告类别必须",
            "pid.exists"=>"非法的广告类别",
        ];

    }
}
